package com.lngsyz.eseal.base.enumeration;

import org.apache.commons.lang.StringUtils;

/**   
 *
 */

public enum EtlTempOpen {
	CLOSED("关闭", "0"),
	OPEN("正常", "1")
	;

	private String name;
	private String key;

	private EtlTempOpen(String name, String key) {
		this.name = name;
		this.key = key;
	}

	public static String getNameByKey(String key) {
		if(StringUtils.isNotBlank(key)) {
			for (EtlTempOpen state : EtlTempOpen.values()) {
				if (state.getKey().equalsIgnoreCase(key)) {
					return state.getName();
				}
			}
		}
		return "";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
}
